﻿<?xml version="1.0" encoding="utf-8" ?>
<DbDataRequest connection="$UserLoginDBConnection$" type="$UserLoginDbType$" defaultFormatter="bizobj UserGroup(appPrivileges)">
  <SqlStatement hasResults="true">
    SELECT @id as id, l.id AS appPrivilegesid, l.privilegeLevel AS privilege
    FROM PrivilegeLevel AS l
    WHERE (ug.userId = @id)
    UNION
    SELECT @id AS id, 0 AS autoNotify, id AS appPrivilegesid, privilegeLevel AS privilege
    FROM PrivilegeLevel AS p
    WHERE (userGroupId = @id)
  </SqlStatement>
  
  <Param name="id" type="UniqueIdentifier" />
</DbDataRequest>
